Optimal. Leaf size=78 \[ \frac{i a (c+d \tan (e+f x))^2}{2 f}+\frac{a d (d+i c) \tan (e+f x)}{f}-\frac{i a (c-i d)^2 \log (\cos (e+f x))}{f}+a x (c-i d)^2 \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0921949, antiderivative size = 78, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {3528, 3525, 3475} \[ \frac{i a (c+d \tan (e+f x))^2}{2 f}+\frac{a d (d+i c) \tan (e+f x)}{f}-\frac{i a (c-i d)^2 \log (\cos (e+f x))}{f}+a x (c-i d)^2 \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3528
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx &=\frac{i a (c+d \tan (e+f x))^2}{2 f}+\int (c+d \tan (e+f x)) (a (c-i d)+a (i c+d) \tan (e+f x)) \, dx\\ &=a (c-i d)^2 x+\frac{a d (i c+d) \tan (e+f x)}{f}+\frac{i a (c+d \tan (e+f x))^2}{2 f}+\left (i a (c-i d)^2\right ) \int \tan (e+f x) \, dx\\ &=a (c-i d)^2 x-\frac{i a (c-i d)^2 \log (\cos (e+f x))}{f}+\frac{a d (i c+d) \tan (e+f x)}{f}+\frac{i a (c+d \tan (e+f x))^2}{2 f}\\ \end{align*}
Mathematica [B] time = 1.78658, size = 175, normalized size = 2.24 \[ \frac{(\cos (f x)-i \sin (f x)) (a+i a \tan (e+f x)) \left (2 d (2 c-i d) (\tan (e)+i) \sin (f x)+4 f x (c-i d)^2 (\cos (e)-i \sin (e)) \cos (e+f x)-i (c-i d)^2 (\cos (e)-i \sin (e)) \cos (e+f x) \log \left (\cos ^2(e+f x)\right )-2 (c-i d)^2 (\cos (e)-i \sin (e)) \cos (e+f x) \tan ^{-1}(\tan (2 e+f x))+d^2 (\sin (e)+i \cos (e)) \sec (e+f x)\right )}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.006, size = 156, normalized size = 2. \begin{align*}{\frac{{\frac{i}{2}}a{d}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{f}}+{\frac{2\,iacd\tan \left ( fx+e \right ) }{f}}+{\frac{a\tan \left ( fx+e \right ){d}^{2}}{f}}-{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){d}^{2}}{f}}+{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){c}^{2}}{f}}+{\frac{a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) cd}{f}}-{\frac{2\,ia\arctan \left ( \tan \left ( fx+e \right ) \right ) cd}{f}}+{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{2}}{f}}-{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ){d}^{2}}{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.49244, size = 127, normalized size = 1.63 \begin{align*} -\frac{-i \, a d^{2} \tan \left (f x + e\right )^{2} - 2 \,{\left (a c^{2} - 2 i \, a c d - a d^{2}\right )}{\left (f x + e\right )} +{\left (-i \, a c^{2} - 2 \, a c d + i \, a d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \,{\left (-2 i \, a c d - a d^{2}\right )} \tan \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.58174, size = 394, normalized size = 5.05 \begin{align*} -\frac{4 \, a c d - 2 i \, a d^{2} + 4 \,{\left (a c d - i \, a d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} -{\left (-i \, a c^{2} - 2 \, a c d + i \, a d^{2} +{\left (-i \, a c^{2} - 2 \, a c d + i \, a d^{2}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (-2 i \, a c^{2} - 4 \, a c d + 2 i \, a d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.88525, size = 128, normalized size = 1.64 \begin{align*} \frac{a \left (- i c^{2} - 2 c d + i d^{2}\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac{- \frac{\left (4 a c d - 4 i a d^{2}\right ) e^{- 2 i e} e^{2 i f x}}{f} - \frac{\left (4 a c d - 2 i a d^{2}\right ) e^{- 4 i e}}{f}}{e^{4 i f x} + 2 e^{- 2 i e} e^{2 i f x} + e^{- 4 i e}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.58246, size = 406, normalized size = 5.21 \begin{align*} \frac{-i \, a c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, a c d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + i \, a d^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 i \, a c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 \, a c d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 2 i \, a d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 \, a c d e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, a d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a c^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, a c d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + i \, a d^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 \, a c d + 2 i \, a d^{2}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]